rellda.tex (725B)
1 \begin{algorithmic} 2 \Function{Rel-\textsc{lda} Generation}{} 3 \FunctionInputs{} \(\alpha\) relations hyperprior 4 \FunctionInputs*{} \(\beta\) features hyperprior 5 \FunctionOutput{} \(\mtrx{F}\) observed features 6 \State 7 \ForAll{relations \(r\)} 8 \ForAll{features \(j\)} 9 \State Choose \(\phi_{rj}\sim\operatorname{Dir}(\beta)\) 10 \EndFor 11 \EndFor 12 \ForAll{documents \(d\)} 13 \State Choose \(\theta_d\sim\operatorname{Dir}(\alpha)\) 14 \ForAll{samples \(i\) in \(d\)} 15 \State Choose \(r\sim\operatorname{Cat}(\theta_d)\) 16 \ForAll{features \(j\)} 17 \State Choose \(f_{ij}\sim\operatorname{Cat}(\phi_{rj})\) 18 \EndFor 19 \EndFor 20 \EndFor 21 \State \Output \(\mtrx{F}\) 22 \EndFunction 23 \end{algorithmic}